const fs = require("fs");
var str = "";
for (let index = 0; index < 500; index++) {
  str += "我是数据库插入的数据,我要保存起来\n";
}
var writeStream = fs.createWriteStream("./data/output.txt");

writeStream.write(str);
// 标记写入完成事件
writeStream.end();
writeStream.on("finish", () => {
  //获取异步数据在这里处理
  console.log("write done");
});
